import request from "@/utils/request";

// 分页列表,按照组合名称模糊查询
export function findStrategyCompositionByPage(data) {
  return request({
    url: "/invest/strategy/findStrategyCompositionByPage",
    method: "post",
    data,
  });
}

// 添加或修改组合
export function addOrUpdateStrategyComposition(data) {
  return request({
    url: "/invest/strategy/addOrUpdateStrategyComposition",
    method: "post",
    data,
  });
}

// 根据id删除组合
export function deleteStrategyCompositionById(data) {
  return request({
    url: "/invest/strategy/deleteStrategyCompositionById",
    method: "post",
    data,
  });
}

////////////////////   详情

// 组合计算状态查询
export function getSaveConfigCompositionInfoStatus(compositionId) {
  return request({
    url:
      "/invest/strategy/getSaveConfigCompositionInfoStatus?compositionId=" +
      compositionId,
    method: "post",
  });
}

// 头部信息
export function getHeadDetail(data) {
  return request({
    url: "/invest/strategy/getCompositionByCompositionId",
    method: "post",
    data,
  });
}

// 收益走势图
export function findNetworthById(data) {
  return request({
    url: "/invest/networth/getCompositionNetworthByCompositionId",
    method: "post",
    data,
  });
}

// 收益走势图 新 分类叠加
export function findCompositionNetworthByCompositionIdNew(data) {
  return request({
    url: "/invest/networth/findCompositionNetworthByCompositionIdNew",
    method: "post",
    data,
  });
}

// 收益走势图 新 分类叠加（组合）
export function getStrategyAndCompositionByCompositionId(data) {
  return request({
    url: "/invest/networth/getStrategyAndCompositionByCompositionId",
    method: "post",
    data,
  });
}

// 最大回撤接口
export function getMaxDown(data) {
  return request({
    url: "/invest/networth/getCompositionMaxDown",
    method: "post",
    data,
  });
}

// 收益风险指标
export function getRiskRateById(data) {
  return request({
    url: "/invest/networth/getCompositionRiskRateByCompositionId",
    method: "post",
    data,
  });
}

// 历史净值列表
export function HistoryNetworthList(data) {
  return request({
    url: "/invest/networth/getCompositionHistory",
    method: "post",
    data,
  });
}

// 历史月度表现
export function findNetWorthMonthly(data) {
  return request({
    url: "/invest/networth/findCompositionNetWorthMonthly",
    method: "post",
    data,
  });
}

// 收益分布-列表
export function findNetWorthExtendBySegment(data) {
  return request({
    url: "/invest/networth/findCompositionNetWorthExtendBySegment",
    method: "post",
    data,
  });
}

// 收益分布-图
export function findNetWorthMonthlyHistogram(data) {
  return request({
    url: "/invest/networth/findCompositionNetWorthMonthlyHistogram",
    method: "post",
    data,
  });
}

// 月度回报-列表
export function findNetWorthMonthDetailByPage(data) {
  return request({
    url: "/invest/networth/findCompositionNetWorthMonthDetailByPage",
    method: "post",
    data,
  });
}

// 月度回报-图
export function findWorthMonthDistribute(data) {
  return request({
    url: "/invest/networth/findCompositionNetWorthMonthDistribute",
    method: "post",
    data,
  });
}

// 分类列表
export function findClassifyByCompositionId(data) {
  return request({
    url: "/invest/strategy/findClassifyByCompositionId",
    method: "post",
    data,
  });
}

// 策略列表
export function findStrategyByCompositionId(data) {
  return request({
    url: "/invest/strategy/findStrategyByCompositionId",
    method: "post",
    data,
  });
}

/////////////////  配置组合

// 详情
export function getCompositionAndClassifysByCompositionId(data) {
  return request({
    url: "/invest/strategy/getCompositionAndClassifysByCompositionId",
    method: "post",
    data,
  });
}

// 历史数据
export function getCompositionTrackInfo(data) {
  return request({
    url: "/invest/strategy/getCompositionTrackInfo?compositionId=" + data,
    method: "post",
  });
}

// 保存
export function configComposition(data) {
  return request({
    url: "/invest/strategy/configComposition",
    method: "post",
    data,
  });
}
// 调仓
export function configurationCompositionNew(data) {
  return request({
    url: "/invest/strategy/configurationCompositionNew",
    method: "post",
    data,
  });
}

// 月度表现弹窗子数据
export function monthlyIncreaseDialog(data) {
  return request({
    url: "/invest/networth/monthlyIncreaseDialog",
    method: "post",
    data,
  });
}

// 月度表现弹窗子数据 -- 策略
export function strategyMonthlyIncreaseDialog(data) {
  return request({
    url: "/invest/networth/strategyMonthlyIncreaseDialog",
    method: "post",
    data,
  });
}

// 组合穿透策略-最大回撤曲线
export function getCompositionMaxDownPlus(data) {
  return request({
    url: "/invest/networth/getCompositionMaxDownPlus",
    method: "post",
    data,
  });
}

// 组合穿透策略-净值曲线
export function getStrategyAndCompositionByCompositionIdPlus(data) {
  return request({
    url: "/invest/networth/getStrategyAndCompositionByCompositionIdPlus",
    method: "post",
    data,
  });
}

// 同区间组合
export function findClassifyIntersection(data) {
  return request({
    url: "/invest/networth/findClassifyIntersection",
    method: "post",
    data,
  });
}

// ----------------- 配置组合/调仓日志 -----------------
export function getConfigurationtime(data) {
  return request({
    url: "/invest/strategy/getConfigurationtime",
    method: "post",
    data,
  });
}
export function getCompositionLog(data) {
  return request({
    url: "/invest/strategy/getCompositionLog",
    method: "post",
    data,
  });
}
export function getClassifyLog(data) {
  return request({
    url: "/invest/strategy/getClassifyLog",
    method: "post",
    data,
  });
}
export function getStrategyLog(data) {
  return request({
    url: "/invest/strategy/getStrategyLog",
    method: "post",
    data,
  });
}

// ----------------- v0.2.0 优化 -----------------

// 组合分类树
export function findCompositionClassifyStrategyByCompositionId(data) {
  return request({
    url: "/invest/strategy/findCompositionClassifyStrategyByCompositionId",
    method: "post",
    data,
  });
}
// 季度收益-组合到分类
export function getCompositionNetWorthIncomByQuarter(data) {
  return request({
    url: "/invest/networth/getCompositionNetWorthIncomByQuarter",
    method: "post",
    data,
  });
}
// 年度收益-组合到分类
export function getCompositionNetWorthIncomByYear(data) {
  return request({
    url: "/invest/networth/getCompositionNetWorthIncomByYear",
    method: "post",
    data,
  });
}
// 区间收益-组合到分类
export function getCompositionAndClassifySegment(data) {
  return request({
    url: "/invest/networth/getCompositionAndClassifySegment",
    method: "post",
    data,
  });
}
// 季度收益-柱状图-组合到分类
export function getQuarterCompositionNetWorthDistribute(data) {
  return request({
    url: "/invest/networth/getQuarterCompositionNetWorthDistribute",
    method: "post",
    data,
  });
}
// 年度收益-柱状图-组合到分类
export function getYearCompositionNetWorthDistribute(data) {
  return request({
    url: "/invest/networth/getYearCompositionNetWorthDistribute",
    method: "post",
    data,
  });
}
// 区间收益-柱状图-组合到分类
export function getSegmentCompositionNetWorthDistribute(data) {
  return request({
    url: "/invest/networth/getSegmentCompositionNetWorthDistribute",
    method: "post",
    data,
  });
}

// 季度收益-组合到策略
export function getCompositionAndStrategyNetWorthByQuarter(data) {
  return request({
    url: "/invest/networth/getCompositionAndStrategyNetWorthByQuarter",
    method: "post",
    data,
  });
}
// 年度收益-组合到策略
export function getCompositionAndStrategyNetWorthByYear(data) {
  return request({
    url: "/invest/networth/getCompositionAndStrategyNetWorthByYear",
    method: "post",
    data,
  });
}
// 区间收益-组合到策略
export function getCompositionAndStrategySegment(data) {
  return request({
    url: "/invest/networth/getCompositionAndStrategySegment",
    method: "post",
    data,
  });
}

// 复制组合
export function copyStrategyComposition(data) {
  return request({
    url: "/invest/strategy/copyStrategyComposition",
    method: "post",
    data,
  });
}

// ----------------- v0.3.0 优化 -----------------

// 组合下投策相关性
export function getCompositionStrategyRelevance(data) {
  return request({
    url: "/invest/networth/getCompositionStrategyRelevance",
    method: "post",
    data,
  });
}

// 组合分类树
export function getCompositionNetWorthByMonthWithWeight(data) {
  return request({
    url: "/invest/networth/getCompositionNetWorthByMonthWithWeight",
    method: "post",
    data,
  });
}

/**
 * 2022-6-20
 * 组合详情 周月报
 */
export function getCompositionWeeklyAndMonthlyReport(data) {
  return request({
    url: "/invest/networth/getCompositionWeeklyAndMonthlyReport",
    method: "post",
    data,
  });
}

/**
 * 2022-12-28
 * 周月报改版
 */
export function weekMonthReport(data) {
  return request({
    url: "/invest/networth/weekMonthReport",
    method: "post",
    data,
  });
}
export function getClassifyReportByCompositionIdAndWeek(data) {
  return request({
    url: "/invest/networth/getClassifyReportByCompositionIdAndWeek",
    method: "post",
    data,
  });
}
export function getStrategyReportByCompositionIdAndWeek(data) {
  return request({
    url: "/invest/networth/getStrategyReportByCompositionIdAndWeek",
    method: "post",
    data,
  });
}

export function monthYearReport(data) {
  return request({
    url: "/invest/networth/monthYearReport",
    method: "post",
    data,
  });
}
export function getClassifyReportByCompositionIdAndMonth(data) {
  return request({
    url: "/invest/networth/getClassifyReportByCompositionIdAndMonth",
    method: "post",
    data,
  });
}
export function getStrategyReportByCompositionIdAndMonth(data) {
  return request({
    url: "/invest/networth/getStrategyReportByCompositionIdAndMonth",
    method: "post",
    data,
  });
}
